﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Castle.ActiveRecord;

namespace ZDSoft.UPMS.Model.SystemPart
{
    /// <summary>
    /// 系统功能类
    /// </summary>
    /// Author：刘祖民
    /// CreateTime:2013-5-22

    [ActiveRecord]
    public class SystemFunction : ModelBase<SystemFunction>
    {
        /// <summary>
        /// 功能名称
        /// </summary>
        [Property]
        public string Name { get; set; }

        /// <summary>
        /// 功能类名
        /// </summary>
        [Property]
        public string ClassName { get; set; }

        /// <summary>
        /// 控制器名称
        /// </summary>
        [Property]
        public string ControllerName { get; set; }

        /// <summary>
        /// 方法名称
        /// </summary>
        [Property]
        public string ActionName { get; set; }

        [BelongsTo("ParentID")]
        public SystemFunction Parent { get; set; }

        [HasMany(typeof(SystemFunction), ColumnKey = "ParentID")]
        public IList<SystemFunction> Childern { get; set; }

        [HasAndBelongsToMany(typeof(Role), Table = "Role_SystemFuntion", ColumnKey = "SystemFuntionID", ColumnRef = "RoleID")]
        public IList<Role> Roles { get; set; }
    }
}
